<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="Aa">
        <img src="01.png" alt="" id="Ab">
    </div>

    <div id="Ba">
        <img src="01.png" alt="">
        <img src="02.png" alt="">
        <img src="03.png" alt="">
        <img src="04.png" alt="">
    </div>
</body>


<script>
    let imgs = document.getElementsByTagName('img');

    for (let i = 0; i < imgs.length; i++){
        imgs[i].onmouseover = function(){
            imgs[0].src = this.src;  
        }
    }

</script>


<style>
    * {
    padding:0;  /* 清除内边距 */
    margin:0;  /* 清除外边距 */
    margin: auto;
    }

    #Aa {
        height: 500px;
        width: 500px;
        background-color: aqua;
    }

    #Ba {
        /* overflow: hidden; */
        height: 150px;
        width: 500px;
        background-color: brown;
    }

    #Ab {
        height: 100%;
        width: 100%;
    }

    img {
        float: left;
        height: 150px;
        width: 125px;
    }
</style>

</html>